package com.chis.jxc;

import com.chis.jm.bean.jxc.CntstmInfoBean;
import com.chis.jmdatatimer.comm.JedisConnect;
import com.chis.jmdatatimer.comm.JedisSerializeUtil;
import com.chis.jmdatatimer.comm.TxMgmtModule;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import redis.clients.jedis.ShardedJedis;
import redis.clients.jedis.ShardedJedisPool;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 
 * @Description 
 * @Company zwx
 * @author wlj
 * @version 2019年03月19日
 */
public class TestJxc1 {
    /**
     * 1查询
     * 2修改
     * @param args
     */
    public static void main(String[] args) {
//        String s = "60A961EA-36A2-C6B7-89FA-313CC0785Faa";
//        System.out.println(s.substring(0,34)+"aa");


            String unitCode = "32000000632022061301,32000000632022061302,32000000632022061303,32000000632022061304,32000000632022061305,32000000632022061306,32000000632022061307,32000000632022061308,32000000632022061309,32000000632022061310,32000000632022061311,32000000632022061312,32000000632022061313,32000000632022061314,32000000632022061315,32000000632022061316,32000000632022061317,32000000632022061318,32000000632022061319,32000000632022061320,32000000632022061321,32000000632022061322,32000000632022061323,32000000632022061324,32000000632022061325,32000000632022061326,32000000632022061327,32000000632022061328,32000000632022061329,32000000632022061330,32000000632022061331,32000000632022061332,32000000632022061333,32000000632022061334";
            ShardedJedisPool jedisPool = JedisConnect.getInstance().jedisPool;
            ShardedJedis jedis = jedisPool.getResource();
            jedis.select(3);
            for(String code : unitCode.split(",")){
                String key = "FH"+code+"1";
                Map<String,String> map1 = jedis.hgetAll(code);
                Map<String,String> map2 = new HashMap<>();
                for(String ss : map1.keySet()){
                    map2.put(ss.substring(0,34)+"aa",map1.get(ss));
                }
                jedis.del(key);
                jedis.hmset(key,map2);
                jedis.expire(key,1209600);

            }
            jedis.close();




    }


}
